package 微信支付;

import cn.com.haiyunhui.common.core.web.domain.AjaxResult;
import cn.com.haiyunhui.handbusy.service.WxReconciliationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @Author: wx
 * @Date: 2023/10/19 14:59
 * @Description: 微信对账
 */
@RestController
@Slf4j
public class WxReconciliationController {

    @Resource
    private WxReconciliationService wxReconciliationService;

    /**
     * 下载昨天的账单
     * @return
     */
    @PostMapping("downloadBill")
    public AjaxResult downloadBill() {
        return wxReconciliationService.downloadBill(null);
    }


    /**
     * 根据时间下载账单
     * @return
     */
    @PostMapping("downloadBills")
    public AjaxResult downloadBills(@RequestParam String time) {
        return wxReconciliationService.downloadBill(time);
    }

    @RequestMapping("getIp")
    public AjaxResult getIp(HttpServletRequest httpServletRequest) {
        return wxReconciliationService.getIp(httpServletRequest);
    }



}
